div#gridLinks {
  margin: 50px auto 0;
  text-align: center;

  &.hidden {
    display: none;
  }

  > ul {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    text-align: left;
    width: min-content;
    margin: auto;
    transition: opacity 0.2s;
    @extend %hidden;

    &.visible {
      @extend %visible;
    }

    > li {
      position: relative;
      display: block;
      font-size: 90%;
      font-weight: $__fontWeightMedium;
      padding: 17px 0;

      > a {
        display: block;
        margin: 0 auto;
        padding: 5px 0 0 0;
        width: 145px;
        text-align: center;
        border-radius: 5px;
        transition: background 0.3s;

        &[data-value="empty"] {
          visibility: hidden;
        }

        > div {
          position: relative;
          width: 52px;
          height: 52px;
          padding: 15px;
          margin: 0 auto 5px;
          background: $contentBackground;
          box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
          border: 1px solid rgba(0, 0, 0, 0.1);
          border-radius: 50%;
          transition: border-color 0.3s, box-shadow 0.3s;

          > img {
            display: block;
            width: 100%;
          }
        }

        > span {
          display: block;
          padding: 5px 7px;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }

        &:hover {
          background: darken($bodyBackground, 5%);

          > div {
            border-color: rgba(0, 0, 0, 0.2);
            box-shadow: 0 3px 20px rgba(0, 0, 0, 0.15);
          }
        }
      }
    }
  }
}

form#search.hidden ~ div#gridLinks {
  margin-top: 0;
}

body.customBackground div#gridLinks {

  > ul > li > a {

    &:hover {
      background: rgba($contentBackground, 0.3);
    }

    > div {
      background: rgba($contentBackground, 0.8);
    }

    > span {
      color: $textColorInverted;
      text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
    }
  }
}

@import "../../rtl/include/newtab/gridLinks";
@import "../../dark/include/newtab/gridLinks";